Skip to content

ci: fix preview workflow — single comment with changed page links#12

Merged
devalog merged 4 commits into
mainfrom
devin/1779477549-fix-preview-workflow
May 26, 2026
Merged

ci: fix preview workflow — single comment with changed page links#12
devalog merged 4 commits into
mainfrom
devin/1779477549-fix-preview-workflow

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented May 22, 2026

Summary

Rewrites the preview workflow to match the pattern used by fern-api/docs:

  • Single job instead of matrix + consolidation — only generates previews for projects that have actual file changes in the PR
  • Changed page links — resolves changed MDX files to page slugs via the /api/fern-docs/get-slug-for-file API and lists them
  • One auto-updating comment — uses comment-tag + upsert to update the same comment on each push
  • Unique preview IDs — uses pr{number}-{project} format to avoid URL collisions from domain label truncation (the old {branch}-{project} IDs exceeded 63 chars for long branch names, causing identical URLs)
  • Adds graphql to all workflow matrices (check, preview, publish)

Comment format per changed project:

:herb: Preview `docs-starter`: <preview-url>

Here are the markdown pages you've updated:
- [slug](preview-url/slug)

If no docs projects have changes (e.g. only workflow files), the comment says "No docs changes detected."

Review & Testing Checklist for Human

  • Open a test PR that changes an MDX file in one project (e.g. docs-starter) and verify the comment shows the preview URL + changed page links
  • Push another commit and verify the comment updates in place
  • Verify the graphql example generates a valid preview with a unique URL

Notes

  • Upgraded thollander/actions-comment-pull-request from v2 to v3 to match fern-api/docs
  • Preview generation runs sequentially per changed project (typically 1-2 projects per PR), which is simpler than the matrix approach and avoids the artifact-passing complexity

Link to Devin session: https://app.devin.ai/sessions/4482e9f954d04c2cae29bfb4731b896d
Requested by: @devalog

- Rewrite preview-docs.yml to use a matrix generate job + a single comment job
- Each matrix job uploads its preview URL as an artifact
- The comment job collects all URLs and posts one consolidated table
- Uses comment_tag + upsert mode to auto-update on each push
- Add graphql example to all workflow matrices (check, preview, publish)

Co-Authored-By: Devin Logan <devinannlogan@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

🌿 No docs changes detected in this PR.

- Single job instead of matrix + consolidation
- Only generate previews for projects with actual file changes
- Use PR number in preview IDs to avoid URL truncation collisions
- Resolve changed MDX files to page slugs via get-slug-for-file API
- Show per-project preview URL with changed page links
- Upgrade to thollander/actions-comment-pull-request@v3

Co-Authored-By: Devin Logan <devinannlogan@gmail.com>
@devin-ai-integration devin-ai-integration Bot changed the title ci: consolidate preview comments into one auto-updating PR comment ci: fix preview workflow — single comment with changed page links May 26, 2026
devin-ai-integration Bot and others added 2 commits May 26, 2026 15:06
Co-Authored-By: Devin Logan <devinannlogan@gmail.com>
@devalog devalog merged commit 8001899 into main May 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant